package com.meihua.baoleyi.adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.meihua.baoleyi.R;
import com.meihua.baoleyi.view.PinnedSectionListView;

/**
 * Created by liming on 2017/10/18.
 */

public class BaseNoWifiAdaper extends BaseAdapter implements PinnedSectionListView.PinnedSectionListAdapter {
    private Context context;
    private int show;

    public BaseNoWifiAdaper(Context context, int show) {
        this.context = context;
        this.show = show;
    }

    @Override
    public int getCount() {
        return 1;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        view = LayoutInflater.from(context).inflate(R.layout.view_no_wifi_or_nodate, null);
        ImageView img = view.findViewById(R.id.img);
        if (show != 1) {
            img.setImageResource(R.drawable.nowifi);
        } else {
            img.setImageResource(R.drawable.empty_view);
        }

        return view;
    }

    @Override
    public boolean isItemViewTypePinned(int viewType) {
        return false;
    }
}
